package com.tvein.sanguo.controller.Game.system
{
	//flash
	//pureMVC
	import org.puremvc.as3.multicore.interfaces.ICommand;
	import org.puremvc.as3.multicore.interfaces.INotification;
	import org.puremvc.as3.multicore.utilities.fabrication.patterns.command.SimpleFabricationCommand;
	//custom
	import com.tvein.sanguo.common.CommonConstants;
//
	public class GameStatus extends SimpleFabricationCommand implements ICommand
	{
		override public function execute(notification:INotification) : void
		{
			var type:String;
			var msg:String;
			var cmd:Array;
			
			switch(notification.getBody()[1][0])
			{
				case 1: //Normal
					type = "message";
					msg = notification.getBody()[1][1];
					break;
				case 2:	//Error
					type = "error";
					msg = notification.getBody()[1][1];
					break;
				case 3:	//Status
					type = "confirm";
					msg = notification.getBody()[1][1];
					break;
			}
			
			routeNotification(CommonConstants.MODULE_INVOKE, ["-system", [type, msg]], null, CommonConstants.MODULE_ACTION + "/*");
		}
		
		//Custom
	}
}